<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">
    <title>点餐</title>
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
</head>
<body class="body">
<!--导航-->
<div th:replace="common/nav :: nav(true)"></div>

<div class="container">

    <div class="row">
        <div style="margin-top: 20px;"></div>
        <div class="row">

            <form class="form-horizontal validate" role="form" method="post" th:action="@{/user/save}"
                  onsubmit="return checkForm(this);">

                <!-- 操作信息提示的地方 -->
                <div th:if="${remind}" class="alert alert-${ remind.level  }"
                     th:classappend="'alert-' + ${remind.level}">
                    <button data-dismiss="alert" class="close" type="button">
                        <i class="glyphicon glyphicon-remove"></i>
                    </button>
                    <span th:remove="tag" th:utext="${ remind.message }"></span>
                </div>


                <div class="form-group">
                    <label for="userName" class="col-md-1 col-sm-1 control-label">用户名</label>
                    <div class="col-sm-9  col-md-9  ">
                        <input type="hidden" class="form-control" id="id" name="id" th:value="${entity?.id}" />
                        <input type="text" class="form-control" id="userName"  th:value="${entity?.userName}" readonly="readonly"
                               placeholder="用户名" autocomplete="off" />
                    </div>
                    <div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
                </div>

                <div class="form-group">
                    <label for="groupId" class="col-md-1 col-sm-1 control-label">所属小组*</label>
                    <div class="col-sm-9  col-md-9  ">
                        <select class="form-control " id="groupId" name="groupId"
                                th:attr="data-value=${entity?.groupId}"
                                data-rule-required="true" data-url="group/all">
                            <option value="">--请选择小组--</option>
                        </select>

                    </div>
                    <div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
                </div>

                <div class="form-group" th:if="${session.principal?.isAdmin()}">
                    <label for="type" class="col-md-1 col-sm-1 control-label">类型*</label>
                    <div class="col-sm-9  col-md-9  ">
                        <select class="form-control " id="type" name="type"
                                th:attr="data-value=${entity?.type}" data-rule-required="true" >
                            <option value="">--请选择类型--</option>
                            <option th:each="item:${types}" th:value="${item.name()}" th:text="${item.text}"></option>
                        </select>

                    </div>
                    <div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
                </div>


                <div class="form-group" th:if="${session.principal?.isAdmin()}">
                    <label for="type" class="col-md-1 col-sm-1 control-label">开发经理</label>
                    <div class="col-sm-9  col-md-9  ">
                        <select class="form-control " id="devManager" name="devManager"
                                th:attr="data-value=${entity?.devManager}"  >
                            <option value="">--请选择--</option>
                            <option value="false">--否--</option>
                            <option value="true">--是--</option>
                        </select>

                    </div>
                    <div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
                </div>

                <div class="form-group" th:if="${session.principal?.isAdmin()}">
                    <label for="type" class="col-md-1 col-sm-1 control-label">状态</label>
                    <div class="col-sm-9  col-md-9  ">
                        <select class="form-control " id="enable" name="enable"
                                th:attr="data-value=${entity?.enable}"  >
                            <option value="">--请选择--</option>
                            <option value="true">--启用--</option>
                            <option value="false">--禁用--</option>
                        </select>

                    </div>
                    <div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
                </div>

                <hr/>

                <div class="form-group clearfix">
                    <div class="text-center col-sm-9">

                        <button th:if="${remind == null}" type="submit" class="btn btn-lg btn-primary">
                            <i class="glyphicon glyphicon-ok"></i> 提交
                        </button>

                        <a type="button" class="btn btn-lg  btn-info" th:href="@{/user/}">
                            <i class="glyphicon glyphicon-repeat"></i> 返回
                        </a>
                    </div>
                </div>

            </form>


        </div>


    </div>
</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script>
    function checkForm(form) {

        return true;
    };



</script>

</body>
</html>